package com.ztx.exception;

import com.ztx.utils.CommonResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class MyException {
    @ExceptionHandler(Exception.class)
    public CommonResult<?> error(Exception e){
        e.printStackTrace();
        return CommonResult.error(1,"操作失败");
    }
}
